<!--
 * @Author: your name
 * @Date: 2020-03-16 14:22:47
 * @LastEditTime: 2020-03-26 10:55:44
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \smart-community\src\views\integral\integralIntroduced.vue
 -->
<template>
  <div class="integralIntroduced">
    <van-nav-bar title="积分介绍" left-arrow @click-left="$router.go(-1)" fixed />
    <div v-if="content !== ''" v-html="content" class="content"></div>
    <p v-if="content === ''" class="no_content">暂无介绍</p>
  </div>
</template>

<script>
import integral from "../../controller/integral";
import constant from "@/controller/constant.js";

export default {
  components: {},
  props: {},
  data() {
    return {
      neighborhoodId: "",
      content: ""
    };
  },
  mounted() {
    this.neighborhoodId = JSON.parse(localStorage.getItem("userInfo")).shequId;

    // this.neighborhoodId = JSON.parse(localStorage.getItem("userInfo")).jiedaoId;

    this.getIntegralIntroduced();
  },
  methods: {
    getIntegralIntroduced() {
      let id = this.neighborhoodId;
      integral.integral_get_one(id).then(res => {
        if (res.code == "0") {
          if (res.datas !== null && res.datas.introduce !== null) {
            this.content = res.datas.introduce;
          }
        } else {
          if (res && res.msg) {
            this.$toast(res.msg);
          } else {
            this.$toast(constant.unusualMsg);
          }
        }
      });
    }
  }
};
</script>
<style lang='scss' scoped>
.integralIntroduced {
  width: 89%;
  height: 100%;
  padding: 20px;
  margin: auto;
  background: #fff;
  .no_content {
    text-align: center;
    font-size: 16px;
    color: #666;
  }
  .content {
    font-size: 16px;
    color: #333;
    text-indent: 2em;
  }
}
</style>